<template>
  <div class="login-box">
    <div class="login-main">
      <div class="login-title">
        <div>
          123后台管理
        </div>
      </div>
      <div class="logtit">ZHONGLVSHANGJIXINSUO</div>
      <div class="div-form">
        <h4
          style="
            color: #fff;
            font-weight: 600;
            font-size: 18px;
            margin: 0.5rem auto 1rem;
          "
        >
          用户登录
        </h4>
        <el-form ref="formRef" :model="form">
          <el-form-item name="username">
            <el-input v-model="form.username" placeholder="姓名"></el-input>
          </el-form-item>
          <el-form-item name="username">
            <el-input v-model="form.password" placeholder="密码"></el-input>
          </el-form-item>
        </el-form>
        <el-button @click="login" type="primary">
          登录
        </el-button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'myLogin',
  data() {
    return {
      form: {
        username: '',
        password: '',
      },
    }
  },
  methods: {
    login() {
      this.$router.replace({ name: 'HelloWorld' })
           // this.$http
      //   .post('/login', this.form)
      //   .then(({ data: res }) => {
      //     console.log('res', res)
      //     if (res.code !== 0) {
      //       return this.$message.error(res.msg)
      //     }
      //   })
      //   .catch(() => {})
    },
  },
}
</script>
<style scoped>
.el-button--primary {
  width: 100%;
}
</style>
